package o;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.huawei.appgallery.foundation.card.base.bean.BaseDistCardBean;
import o.ewm.h;
import o.ewm.j;
import o.ewm.n;

public class ebt implements ewa {
    private cku ˋ;
    private Context ˎ;
    private BaseDistCardBean ˏ;
    private CheckBox ॱ;

    public ebt(@NonNull Context context, @NonNull BaseDistCardBean baseDistCardBean) {
        this.ˎ = context;
        this.ˏ = baseDistCardBean;
        this.ˋ = cku.ˋ(context.getString(n.ͺـ), null);
        this.ˋ.ˊ(ˋ());
        this.ˋ.ॱ(-1, context.getString(n.ˊʾ));
        this.ˋ.ˋ((ewa) this);
    }

    private View ˋ() {
        View inflate = LayoutInflater.from(this.ˎ).inflate(h.ꜞॱ, null);
        String string = this.ˎ.getString(n.ˊʾ);
        ((TextView) inflate.findViewById(j.ᐝᵎ)).setText(this.ˎ.getString(n.ՙᐝ, new Object[]{string}));
        this.ॱ = (CheckBox) inflate.findViewById(j.ᐝᶫ);
        this.ॱ.setText(n.ʿˊ);
        return inflate;
    }

    public void ˊ() {
        Object obj = 1;
        Object obj2 = (HcridSession.ˋ().appsstoreGMSSupport() && !TextUtils.isEmpty(this.ˏ.gplinkPkgName_) && this.ˏ.jumpToGpOnGMSDevice_ == 1) ? 1 : null;
        if (obj2 != null && new dkg().ॱ(this.ˎ, this.ˏ.gplinkPkgName_)) {
            ebv.ॱ(this.ˏ.ॱـ(), this.ˏ.gplinkPkgName_);
        } else if (TextUtils.isEmpty(this.ˏ.ˊॱ())) {
            Logger.ˎ("NoApkAppWarnDialog", "It can't jump! the gpUrl is " + this.ˏ.gplinkPkgName_ + " fUrl is empty? " + TextUtils.isEmpty(this.ˏ.ˊॱ()));
        } else {
            if (this.ˏ.showDisclaimer_ != 1 || ehb.ˏ().ॱ()) {
                obj = null;
            }
            if (obj != null) {
                this.ˋ.ˎ(this.ˎ);
            } else {
                ˊ(this.ˎ);
            }
        }
    }

    public void ˏ(Activity activity, DialogInterface dialogInterface, int i) {
        if (i == -1) {
            if (this.ॱ != null) {
                ehb.ˏ().ॱ(this.ॱ.isChecked());
                ebv.ˋ(this.ˏ.ॱـ(), this.ˏ.ˊॱ(), this.ॱ.isChecked());
            }
            ˊ(activity);
        }
    }

    private void ˊ(Context context) {
        try {
            if (this.ˏ.genShortcutForWebApp_ == 1 && this.ˏ.webApp_ == 1) {
                new ebs(context, this.ˏ).ˎ();
                return;
            }
            ebv.ॱ(this.ˏ.ॱـ(), this.ˏ.ˊॱ());
            enx.ˏ(context, this.ˏ.ˊॱ());
        } catch (Exception e) {
            Logger.e("NoApkAppWarnDialog", "skip fail e = " + e.getMessage());
        }
    }

    public void ˊ(Activity activity, DialogInterface dialogInterface) {
    }
}
